package com.atguigu.url.json;

import com.atguigu.url.util.TaskSplitUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;

/**
 * @version V1.0
 * @author: guangcheng
 * @date: 2021/11/16 15:41
 * @description:
 */
@SpringBootTest
public class SplitListToListList {

    @Autowired
    TaskSplitUtil taskSplitUtil;


    @Test
    public void listList() {

        ArrayList<String> list = new ArrayList<>();
        for (int i = 0; i < 193; i++) {
            list.add(i + "");
        }
        ArrayList<ArrayList<String>> arrayLists = taskSplitUtil.listSplitTo2List(list, 8);
        System.out.println("list list size = " + arrayLists.size());


        for (ArrayList<String> arrayList : arrayLists) {
            System.out.println("=====================================");
            arrayList.forEach(System.out::println);
        }
    }
}

